package com.open.capacity.finance.constant;

import com.fasterxml.jackson.annotation.JsonCreator;

public enum AuditWarnCategorys {

    FINANCE("finance", "账务处理"),
    PAY("pay", "支付管理"),
    REIMBURSE("reimburse", "资金效益"),
    ASSET("asset", "固定资产"),
    CAR("car", "公车管理"),
    PURCHASE("purchase", "政府采购"),
    OTHER("other", "其他");


    private String code;
    private String text;

    AuditWarnCategorys(String code, String text) {
        this.code = code;
        this.text = text;
    }

    public String getCode() {
        return this.code;
    }

    public String getText() {
        return this.text;
    }

    @JsonCreator
    public static AuditWarnCategorys valueOfEnum(String code) {

        AuditWarnCategorys[] bss = values();

        for (AuditWarnCategorys bs : bss) {
            if (bs.getCode() == code) {
                return bs;
            }
        }

        throw new IllegalArgumentException("code:" + code + "不存在!");
    }
}
